{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Imports\n",
    "\n",
    "Import all the modules and functionalities we need."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "# Import standard libraries.\n",
    "import os\n",
    "\n",
    "# Import third party libraries.\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "from statsmodels.stats.multitest import multipletests\n",
    "\n",
    "# Import custom libraries/scripts.\n",
    "import annotations\n",
    "import helpers"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Loading data\n",
    "\n",
    "Fetch all our relevant data for the current analysis."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set working contants.\n",
    "EXPERIMENTS_PATH = r'E:\\Miguel\\PhD\\Results\\Competition\\DL\\Four-Arena Setup\\WT_mating_status\\processed'\n",
    "FPS = 60\n",
    "N_MINUTES = 60\n",
    "N_FRAMES = N_MINUTES * 60 * FPS\n",
    "INK = 'black'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set figure configurations.\n",
    "sns.set(\n",
    "        context='talk',\n",
    "        style='ticks',\n",
    "        font='sans-serif',\n",
    "        font_scale=1.0, \n",
    "        rc={\n",
    "            'axes.axisbelow': True,\n",
    "            'axes.edgecolor': INK,\n",
    "            'axes.facecolor': 'white' if INK=='black' else 'black',\n",
    "            'axes.grid': False,\n",
    "            'axes.labelcolor': INK,\n",
    "            'axes.labelsize': 13.0,\n",
    "            'axes.labelweight': 'normal',\n",
    "            'axes.linewidth': 1.2,\n",
    "            'axes.spines.left': True,\n",
    "            'axes.spines.bottom': True,\n",
    "            'axes.spines.top': False,\n",
    "            'axes.spines.right': False,\n",
    "            'axes.titlepad': 15.0,\n",
    "            'axes.titlesize': 20.0,\n",
    "            'axes.titleweight': 'bold',\n",
    "            'figure.facecolor': 'white' if INK=='black' else 'black',\n",
    "            'figure.figsize': [4.0, 4.0],\n",
    "            'figure.titlesize': 18.0,\n",
    "            'figure.titleweight': 'bold',\n",
    "            'font.family': ['sans-serif'],\n",
    "            'font.sans-serif': ['Arial'],\n",
    "            'legend.frameon': False,\n",
    "            'legend.fontsize': 11.0,\n",
    "            'lines.color': INK,\n",
    "            'lines.linewidth': 1.0,\n",
    "            'patch.edgecolor': INK,\n",
    "            'patch.linewidth': 1.0,\n",
    "            'savefig.dpi': 300,\n",
    "            'savefig.format': 'png',\n",
    "            'savefig.bbox': 'tight',\n",
    "            'savefig.transparent': True,\n",
    "            'text.color': INK,\n",
    "            'text.usetex': False,\n",
    "            'xtick.color': INK,\n",
    "            'xtick.direction': 'out',\n",
    "            'xtick.labelsize': 12.0,\n",
    "            'xtick.major.pad': 5.0,\n",
    "            'xtick.major.size': 0.0,\n",
    "            'xtick.major.width': 1.0,\n",
    "            'xtick.minor.size': 0.0,\n",
    "            'xtick.minor.width': 0.4,\n",
    "            'ytick.color': INK,\n",
    "            'ytick.direction': 'out',\n",
    "            'ytick.labelsize': 12.0,\n",
    "            'ytick.major.pad': 5.0,\n",
    "            'ytick.major.size': 3.0,\n",
    "            'ytick.major.width': 1.2,\n",
    "            'ytick.minor.size': 0.0,\n",
    "            'ytick.minor.width': 0.4\n",
    "           }\n",
    "       )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Folder already exists, skipping.\n"
     ]
    }
   ],
   "source": [
    "# Prepare the Figures folder to save our graphs in.\n",
    "savepath = os.path.join(r'C:\\Users\\Miguel\\Desktop\\paper_data', 'paper_figures', 'figure3')\n",
    "try:\n",
    "    os.makedirs(savepath)\n",
    "    print('New folder created.')\n",
    "except FileExistsError:\n",
    "    print('Folder already exists, skipping.')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Paths to conditions:\n",
      " ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h', '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h', '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin']\n"
     ]
    }
   ],
   "source": [
    "# Set the conditions to analyze.\n",
    "condition_order = ['virgin_virgin', 'virgin_mated24h', 'virgin_mated2h']\n",
    "conditions = [item.path for item in os.scandir(EXPERIMENTS_PATH) if item.name in condition_order]\n",
    "print('Paths to conditions:\\n', conditions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['video_2017-09-05T14_34_55_arena4', 'video_2017-09-12T14_36_55_arena4', 'video_2017-09-14T13_34_41_arena2', 'video_2017-09-21T14_47_10_arena3', 'video_2017-09-21T14_47_10_arena4', 'video_2017-09-26T13_40_19_arena4', 'video_2017-09-27T16_21_07_arena1', 'video_2017-09-27T16_21_07_arena3', 'video_2017-09-28T15_55_49_arena2', 'video_2017-10-12T14_34_41_arena2', 'video_2017-10-18T14_05_05_arena3', 'video_2017-10-19T14_58_20_arena1', 'video_2017-10-24T14_48_34_arena1', 'video_2017-10-24T14_48_34_arena4', 'video_2017-10-25T13_39_35_arena4', 'video_2017-11-03T14_54_45_arena2', 'video_2017-09-05T15_42_04_arena1', 'video_2017-11-02T16_11_06_arena1', 'video_2017-12-19T16_23_33_arena4', 'video_2017-09-05T15_42_04_arena3', 'video_2017-09-07T13_28_02_arena4']\n",
      "21\n"
     ]
    }
   ],
   "source": [
    "# Create a list of all the experiments that we DO NOT want to analyze.\n",
    "intruders = []\n",
    "for condition in conditions:\n",
    "    for file in os.listdir(condition):\n",
    "        if 'quality_control' in file:\n",
    "\n",
    "            # Read the quality.csv file to check which experiments are usable for analysis.\n",
    "            quality_file = os.path.join(condition, file)\n",
    "            quality_df = pd.read_csv(quality_file, usecols=[0,1], index_col=0)\n",
    "            quality_df = quality_df[quality_df['is_usable'] == False].index.values\n",
    "\n",
    "            for value in quality_df:\n",
    "                intruders.append(value)\n",
    "\n",
    "print(intruders)             \n",
    "print(len(intruders))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\t\n",
      " virgin_mated24h\n",
      "Copulation too short: video_2017-09-20T14_48_55_arena3\n",
      "\t\n",
      " virgin_mated2h\n",
      "\t\n",
      " virgin_virgin\n",
      "Copulation too short: video_2017-09-06T13_42_13_arena3\n",
      "Copulation too short: video_2017-09-26T14_52_18_arena3\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'virgin_virgin': ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-05T13_28_41_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-05T14_34_55_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-06T13_42_13_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-06T14_45_32_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-07T14_37_38_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-07T14_37_38_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-08T13_26_13_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-12T13_30_06_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-12T14_36_55_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-12T16_18_15_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-13T14_34_18_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-20T13_43_53_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-20T14_48_55_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-21T13_38_55_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-21T15_57_23_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-26T13_40_19_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-28T13_36_06_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-28T14_44_01_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-09-28T15_55_49_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-10-12T15_50_43_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-10-13T16_06_33_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-10-18T15_19_17_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-10-19T13_50_56_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-10-20T13_21_06_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-10-20T15_44_09_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-10-24T16_13_35_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-10-25T14_55_12_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-11-02T13_37_48_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-11-02T14_48_28_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-11-02T16_11_06_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-11-03T14_54_45_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-11-03T16_20_50_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-12-20T12_58_51_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_virgin\\\\video_2017-12-20T14_01_01_arena3'],\n",
       " 'virgin_mated24h': ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-05T13_28_41_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-07T16_01_26_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-08T14_31_59_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-08T14_31_59_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-12T13_30_06_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-13T15_40_03_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-14T14_47_16_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-20T13_43_53_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-26T14_52_18_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-09-27T15_06_20_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-11T13_30_05_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-11T16_00_50_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-13T14_37_35_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-13T14_37_35_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-13T14_37_35_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-19T13_50_56_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-19T14_58_20_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-19T16_19_37_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-20T14_31_24_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-20T14_31_24_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-24T13_43_26_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-25T13_39_35_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-25T14_55_12_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-25T14_55_12_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-26T13_35_36_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-10-26T14_43_16_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-11-03T13_38_06_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-11-03T13_38_06_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-11-03T13_38_06_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated24h\\\\video_2017-11-03T16_20_50_arena3'],\n",
       " 'virgin_mated2h': ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-06T15_53_34_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-07T16_01_26_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-07T16_01_26_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-08T15_42_18_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-08T15_42_18_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-13T15_40_03_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-14T15_53_40_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-20T16_07_55_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-21T15_57_23_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-21T15_57_23_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-26T16_06_31_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-26T16_06_31_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-09-28T15_55_49_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-11T16_00_50_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-11T16_00_50_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-11T16_00_50_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-12T15_50_43_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-13T16_06_33_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-18T16_37_02_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-18T16_37_02_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-19T16_19_37_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-19T16_19_37_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-25T16_23_26_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-10-25T16_23_26_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-11-02T16_11_06_arena4',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-12-19T15_13_55_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-12-19T15_13_55_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-12-19T16_23_33_arena1',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-12-19T16_23_33_arena2',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-12-19T16_23_33_arena3',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\Four-Arena Setup\\\\WT_mating_status\\\\processed\\\\virgin_mated2h\\\\video_2017-12-20T15_08_53_arena2']}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "experiments = {condition: [] for condition in condition_order}\n",
    "\n",
    "for condition_path in conditions:\n",
    "    \n",
    "    condition = os.path.basename(condition_path)\n",
    "    print('\\t\\n', condition)\n",
    "    \n",
    "    for item in os.scandir(condition_path):\n",
    "        if item.is_dir() and item.name not in intruders:\n",
    "            \n",
    "            annotation_video = annotations.read(item.path + '.csv')\n",
    "            \n",
    "            try:\n",
    "                copulation = annotation_video[0].events[0]\n",
    "\n",
    "                # Filter out videos where copulation is interrupted.\n",
    "                copulation_end = copulation.time_interval[1]\n",
    "                if copulation_end==N_FRAMES:\n",
    "                    print('Copulation interrupted:', item.name)\n",
    "                    continue\n",
    "\n",
    "                # Filter out videos where copulation lasts less than 8 minutes.\n",
    "                copulation_duration = copulation.duration\n",
    "                if copulation_duration <= 8 * 60 * FPS:\n",
    "                    print('Copulation too short:', item.name)\n",
    "                    continue\n",
    "            \n",
    "            except IndexError:\n",
    "                continue\n",
    "            \n",
    "            experiments[condition].append(item.path)\n",
    "\n",
    "experiments"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Get distance walked per frame (in mm) from the start of each video until the end of copulation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "virgin_virgin\n",
      "video_2017-09-05T13_28_41_arena4\n",
      "video_2017-09-05T14_34_55_arena2\n",
      "video_2017-09-06T13_42_13_arena1\n",
      "video_2017-09-06T14_45_32_arena3\n",
      "video_2017-09-07T14_37_38_arena3\n",
      "video_2017-09-07T14_37_38_arena4\n",
      "video_2017-09-08T13_26_13_arena3\n",
      "video_2017-09-12T13_30_06_arena4\n",
      "video_2017-09-12T14_36_55_arena3\n",
      "video_2017-09-12T16_18_15_arena4\n",
      "video_2017-09-13T14_34_18_arena2\n",
      "video_2017-09-20T13_43_53_arena3\n",
      "video_2017-09-20T14_48_55_arena2\n",
      "video_2017-09-21T13_38_55_arena4\n",
      "video_2017-09-21T15_57_23_arena2\n",
      "video_2017-09-26T13_40_19_arena1\n",
      "video_2017-09-28T13_36_06_arena4\n",
      "video_2017-09-28T14_44_01_arena3\n",
      "video_2017-09-28T15_55_49_arena3\n",
      "video_2017-10-12T15_50_43_arena2\n",
      "video_2017-10-13T16_06_33_arena2\n",
      "video_2017-10-18T15_19_17_arena3\n",
      "video_2017-10-19T13_50_56_arena2\n",
      "video_2017-10-20T13_21_06_arena2\n",
      "video_2017-10-20T15_44_09_arena2\n",
      "video_2017-10-24T16_13_35_arena4\n",
      "video_2017-10-25T14_55_12_arena1\n",
      "video_2017-11-02T13_37_48_arena3\n",
      "video_2017-11-02T14_48_28_arena4\n",
      "video_2017-11-02T16_11_06_arena3\n",
      "video_2017-11-03T14_54_45_arena1\n",
      "video_2017-11-03T16_20_50_arena4\n",
      "video_2017-12-20T12_58_51_arena4\n",
      "video_2017-12-20T14_01_01_arena3\n",
      "virgin_mated24h\n",
      "video_2017-09-05T13_28_41_arena3\n",
      "video_2017-09-07T16_01_26_arena4\n",
      "video_2017-09-08T14_31_59_arena2\n",
      "video_2017-09-08T14_31_59_arena3\n",
      "video_2017-09-12T13_30_06_arena1\n",
      "video_2017-09-13T15_40_03_arena1\n",
      "video_2017-09-14T14_47_16_arena4\n",
      "video_2017-09-20T13_43_53_arena1\n",
      "video_2017-09-26T14_52_18_arena2\n",
      "video_2017-09-27T15_06_20_arena3\n",
      "video_2017-10-11T13_30_05_arena1\n",
      "video_2017-10-11T16_00_50_arena4\n",
      "video_2017-10-13T14_37_35_arena1\n",
      "video_2017-10-13T14_37_35_arena2\n",
      "video_2017-10-13T14_37_35_arena3\n",
      "video_2017-10-19T13_50_56_arena4\n",
      "video_2017-10-19T14_58_20_arena3\n",
      "video_2017-10-19T16_19_37_arena2\n",
      "video_2017-10-20T14_31_24_arena3\n",
      "video_2017-10-20T14_31_24_arena4\n",
      "video_2017-10-24T13_43_26_arena3\n",
      "video_2017-10-25T13_39_35_arena1\n",
      "video_2017-10-25T14_55_12_arena2\n",
      "video_2017-10-25T14_55_12_arena3\n",
      "video_2017-10-26T13_35_36_arena2\n",
      "video_2017-10-26T14_43_16_arena3\n",
      "video_2017-11-03T13_38_06_arena2\n",
      "video_2017-11-03T13_38_06_arena3\n",
      "video_2017-11-03T13_38_06_arena4\n",
      "video_2017-11-03T16_20_50_arena3\n",
      "virgin_mated2h\n",
      "video_2017-09-06T15_53_34_arena1\n",
      "video_2017-09-07T16_01_26_arena1\n",
      "video_2017-09-07T16_01_26_arena2\n",
      "video_2017-09-08T15_42_18_arena1\n",
      "video_2017-09-08T15_42_18_arena3\n",
      "video_2017-09-13T15_40_03_arena4\n",
      "video_2017-09-14T15_53_40_arena3\n",
      "video_2017-09-20T16_07_55_arena4\n",
      "video_2017-09-21T15_57_23_arena1\n",
      "video_2017-09-21T15_57_23_arena4\n",
      "video_2017-09-26T16_06_31_arena1\n",
      "video_2017-09-26T16_06_31_arena3\n",
      "video_2017-09-28T15_55_49_arena1\n",
      "video_2017-10-11T16_00_50_arena1\n",
      "video_2017-10-11T16_00_50_arena2\n",
      "video_2017-10-11T16_00_50_arena3\n",
      "video_2017-10-12T15_50_43_arena4\n",
      "video_2017-10-13T16_06_33_arena4\n",
      "video_2017-10-18T16_37_02_arena3\n",
      "video_2017-10-18T16_37_02_arena4\n",
      "video_2017-10-19T16_19_37_arena1\n",
      "video_2017-10-19T16_19_37_arena4\n",
      "video_2017-10-25T16_23_26_arena1\n",
      "video_2017-10-25T16_23_26_arena3\n",
      "video_2017-11-02T16_11_06_arena4\n",
      "video_2017-12-19T15_13_55_arena2\n",
      "video_2017-12-19T15_13_55_arena3\n",
      "video_2017-12-19T16_23_33_arena1\n",
      "video_2017-12-19T16_23_33_arena2\n",
      "video_2017-12-19T16_23_33_arena3\n",
      "video_2017-12-20T15_08_53_arena2\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pos_x</th>\n",
       "      <th>pos_y</th>\n",
       "      <th>vel</th>\n",
       "      <th>copulation</th>\n",
       "      <th>condition</th>\n",
       "      <th>experiment</th>\n",
       "      <th>has_aggression</th>\n",
       "      <th>dist_walked_mm</th>\n",
       "      <th>dist_walked_meters</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>161.99</td>\n",
       "      <td>86.105</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>before</td>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-09-05T13_28_41_arena4</td>\n",
       "      <td>True</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>161.99</td>\n",
       "      <td>86.105</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>before</td>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-09-05T13_28_41_arena4</td>\n",
       "      <td>True</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>161.99</td>\n",
       "      <td>86.105</td>\n",
       "      <td>0.19732</td>\n",
       "      <td>before</td>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-09-05T13_28_41_arena4</td>\n",
       "      <td>True</td>\n",
       "      <td>0.003289</td>\n",
       "      <td>0.000003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>161.92</td>\n",
       "      <td>86.194</td>\n",
       "      <td>0.64946</td>\n",
       "      <td>before</td>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-09-05T13_28_41_arena4</td>\n",
       "      <td>True</td>\n",
       "      <td>0.010824</td>\n",
       "      <td>0.000011</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>161.71</td>\n",
       "      <td>86.145</td>\n",
       "      <td>1.97140</td>\n",
       "      <td>before</td>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-09-05T13_28_41_arena4</td>\n",
       "      <td>True</td>\n",
       "      <td>0.032857</td>\n",
       "      <td>0.000033</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100458</th>\n",
       "      <td>173.69</td>\n",
       "      <td>103.980</td>\n",
       "      <td>2.62200</td>\n",
       "      <td>during</td>\n",
       "      <td>virgin_mated2h</td>\n",
       "      <td>video_2017-12-20T15_08_53_arena2</td>\n",
       "      <td>True</td>\n",
       "      <td>0.043700</td>\n",
       "      <td>0.000044</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100459</th>\n",
       "      <td>173.45</td>\n",
       "      <td>103.860</td>\n",
       "      <td>1.80180</td>\n",
       "      <td>during</td>\n",
       "      <td>virgin_mated2h</td>\n",
       "      <td>video_2017-12-20T15_08_53_arena2</td>\n",
       "      <td>True</td>\n",
       "      <td>0.030030</td>\n",
       "      <td>0.000030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100460</th>\n",
       "      <td>173.35</td>\n",
       "      <td>103.590</td>\n",
       "      <td>1.65710</td>\n",
       "      <td>during</td>\n",
       "      <td>virgin_mated2h</td>\n",
       "      <td>video_2017-12-20T15_08_53_arena2</td>\n",
       "      <td>True</td>\n",
       "      <td>0.027618</td>\n",
       "      <td>0.000028</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100461</th>\n",
       "      <td>173.34</td>\n",
       "      <td>103.380</td>\n",
       "      <td>1.81800</td>\n",
       "      <td>during</td>\n",
       "      <td>virgin_mated2h</td>\n",
       "      <td>video_2017-12-20T15_08_53_arena2</td>\n",
       "      <td>True</td>\n",
       "      <td>0.030300</td>\n",
       "      <td>0.000030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100462</th>\n",
       "      <td>173.27</td>\n",
       "      <td>103.020</td>\n",
       "      <td>1.50940</td>\n",
       "      <td>during</td>\n",
       "      <td>virgin_mated2h</td>\n",
       "      <td>video_2017-12-20T15_08_53_arena2</td>\n",
       "      <td>True</td>\n",
       "      <td>0.025157</td>\n",
       "      <td>0.000025</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8275032 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         pos_x    pos_y      vel copulation       condition  \\\n",
       "0       161.99   86.105  0.00000     before   virgin_virgin   \n",
       "1       161.99   86.105  0.00000     before   virgin_virgin   \n",
       "2       161.99   86.105  0.19732     before   virgin_virgin   \n",
       "3       161.92   86.194  0.64946     before   virgin_virgin   \n",
       "4       161.71   86.145  1.97140     before   virgin_virgin   \n",
       "...        ...      ...      ...        ...             ...   \n",
       "100458  173.69  103.980  2.62200     during  virgin_mated2h   \n",
       "100459  173.45  103.860  1.80180     during  virgin_mated2h   \n",
       "100460  173.35  103.590  1.65710     during  virgin_mated2h   \n",
       "100461  173.34  103.380  1.81800     during  virgin_mated2h   \n",
       "100462  173.27  103.020  1.50940     during  virgin_mated2h   \n",
       "\n",
       "                              experiment  has_aggression  dist_walked_mm  \\\n",
       "0       video_2017-09-05T13_28_41_arena4            True        0.000000   \n",
       "1       video_2017-09-05T13_28_41_arena4            True        0.000000   \n",
       "2       video_2017-09-05T13_28_41_arena4            True        0.003289   \n",
       "3       video_2017-09-05T13_28_41_arena4            True        0.010824   \n",
       "4       video_2017-09-05T13_28_41_arena4            True        0.032857   \n",
       "...                                  ...             ...             ...   \n",
       "100458  video_2017-12-20T15_08_53_arena2            True        0.043700   \n",
       "100459  video_2017-12-20T15_08_53_arena2            True        0.030030   \n",
       "100460  video_2017-12-20T15_08_53_arena2            True        0.027618   \n",
       "100461  video_2017-12-20T15_08_53_arena2            True        0.030300   \n",
       "100462  video_2017-12-20T15_08_53_arena2            True        0.025157   \n",
       "\n",
       "        dist_walked_meters  \n",
       "0                 0.000000  \n",
       "1                 0.000000  \n",
       "2                 0.000003  \n",
       "3                 0.000011  \n",
       "4                 0.000033  \n",
       "...                    ...  \n",
       "100458            0.000044  \n",
       "100459            0.000030  \n",
       "100460            0.000028  \n",
       "100461            0.000030  \n",
       "100462            0.000025  \n",
       "\n",
       "[8275032 rows x 9 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_distance = []\n",
    "distance_during_copulation = {condition: {} for condition in condition_order}\n",
    "distance_before_copulation = {condition: {} for condition in condition_order}\n",
    "distance_df = pd.DataFrame()\n",
    "\n",
    "# Set features to extract from trackfeat files.\n",
    "features = ['pos x', 'pos y', 'vel']\n",
    "\n",
    "for condition in condition_order:\n",
    "    \n",
    "    print(condition)\n",
    "    \n",
    "    for experiment_path in experiments[condition]:\n",
    "        \n",
    "        control = True if condition == 'virgin_virgin' else False\n",
    "\n",
    "        aggression_df, mating_df, copulation_time, aggression_timepoints = helpers.process_track_data(experiment_path,\n",
    "                                                                                                      include_aggression_only=False,\n",
    "                                                                                                      fly_id=2,\n",
    "                                                                                                      is_control=control,\n",
    "                                                                                                      trackfeat_columns=features,\n",
    "                                                                                                      suppress=True\n",
    "                                                                                                     )\n",
    "        if aggression_df is None or mating_df is None:\n",
    "            continue\n",
    "\n",
    "        experiment = os.path.basename(experiment_path)\n",
    "        \n",
    "        print(experiment)\n",
    "\n",
    "        # Slice the aggressive female's data only up until end of copulation - we do not care about what happens after that.\n",
    "        copulation_start = copulation_time[0]\n",
    "        copulation_end = copulation_time[1]\n",
    "        aggression_slice = aggression_df.loc[:copulation_end-1, :].copy()\n",
    "        aggression_slice.fillna(method='ffill', inplace=True)\n",
    "        aggression_slice = aggression_slice[aggression_slice['vel'] < 20]  # Filter out jumps.\n",
    "\n",
    "        # Categorize frames from before copulation or duting copulation so we can later compare these two moments.\n",
    "        aggression_slice['copulation'] = aggression_slice.index < copulation_start\n",
    "        aggression_slice['copulation'] = aggression_slice['copulation'].map({True: 'before', False: 'during'})\n",
    "        aggression_slice['condition'] = condition\n",
    "        aggression_slice['experiment'] = experiment\n",
    "        aggression_slice['has_aggression'] = True if len(aggression_timepoints) > 0 else False\n",
    "\n",
    "        aggression_during_copulation = aggression_df.loc[copulation_start:copulation_end-1, :].copy()\n",
    "        aggression_during_copulation.fillna(method='ffill', inplace=True)\n",
    "        aggression_before_copulation = aggression_df.loc[:copulation_start-1, :].copy()\n",
    "        aggression_before_copulation.fillna(method='ffill', inplace=True)\n",
    "\n",
    "        # Calculate distance walked per frame based on the velocity column.\n",
    "        aggression_slice['dist_walked_mm'] = (aggression_slice['vel'] / 60)\n",
    "        aggression_slice['dist_walked_meters'] = (aggression_slice['vel'] / 60 / 1000)\n",
    "        aggression_during_copulation['dist_walked_mm'] = (aggression_during_copulation['vel'] / 60)\n",
    "        aggression_before_copulation['dist_walked_mm'] = (aggression_before_copulation['vel'] / 60)\n",
    "        \n",
    "        total_distance.append(sum(aggression_slice['dist_walked_mm']))\n",
    "        distance_during_copulation[condition][experiment] = sum(aggression_during_copulation['dist_walked_mm'])\n",
    "        distance_before_copulation[condition][experiment] = sum(aggression_before_copulation['dist_walked_mm'])\n",
    "\n",
    "        distance_df = pd.concat([distance_df, aggression_slice], axis=0)\n",
    "\n",
    "distance_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>condition</th>\n",
       "      <th>experiment</th>\n",
       "      <th>pos_x</th>\n",
       "      <th>pos_y</th>\n",
       "      <th>vel</th>\n",
       "      <th>has_aggression</th>\n",
       "      <th>dist_walked_mm</th>\n",
       "      <th>dist_walked_meters</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>virgin_mated24h</td>\n",
       "      <td>video_2017-09-05T13_28_41_arena3</td>\n",
       "      <td>1.536981e+07</td>\n",
       "      <td>1.684179e+07</td>\n",
       "      <td>565503.122424</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9425.052040</td>\n",
       "      <td>9.425052</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>virgin_mated24h</td>\n",
       "      <td>video_2017-09-07T16_01_26_arena4</td>\n",
       "      <td>1.569941e+07</td>\n",
       "      <td>1.569519e+07</td>\n",
       "      <td>454586.350065</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7576.439168</td>\n",
       "      <td>7.576439</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>virgin_mated24h</td>\n",
       "      <td>video_2017-09-08T14_31_59_arena2</td>\n",
       "      <td>1.199031e+07</td>\n",
       "      <td>1.093266e+07</td>\n",
       "      <td>354113.452806</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5901.890880</td>\n",
       "      <td>5.901891</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>virgin_mated24h</td>\n",
       "      <td>video_2017-09-08T14_31_59_arena3</td>\n",
       "      <td>1.111254e+07</td>\n",
       "      <td>1.272907e+07</td>\n",
       "      <td>315779.688209</td>\n",
       "      <td>59403.0</td>\n",
       "      <td>5262.994803</td>\n",
       "      <td>5.262995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>virgin_mated24h</td>\n",
       "      <td>video_2017-09-12T13_30_06_arena1</td>\n",
       "      <td>2.182715e+07</td>\n",
       "      <td>2.181400e+07</td>\n",
       "      <td>776363.427397</td>\n",
       "      <td>113256.0</td>\n",
       "      <td>12939.390457</td>\n",
       "      <td>12.939390</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-11-02T16_11_06_arena3</td>\n",
       "      <td>1.680257e+07</td>\n",
       "      <td>1.717971e+07</td>\n",
       "      <td>474072.728796</td>\n",
       "      <td>84193.0</td>\n",
       "      <td>7901.212147</td>\n",
       "      <td>7.901212</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-11-03T14_54_45_arena1</td>\n",
       "      <td>8.567400e+06</td>\n",
       "      <td>9.095781e+06</td>\n",
       "      <td>326104.065283</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5435.067755</td>\n",
       "      <td>5.435068</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-11-03T16_20_50_arena4</td>\n",
       "      <td>1.998000e+07</td>\n",
       "      <td>2.036970e+07</td>\n",
       "      <td>710729.939317</td>\n",
       "      <td>101285.0</td>\n",
       "      <td>11845.498989</td>\n",
       "      <td>11.845499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>93</th>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-12-20T12_58_51_arena4</td>\n",
       "      <td>1.901919e+07</td>\n",
       "      <td>1.845194e+07</td>\n",
       "      <td>648959.570321</td>\n",
       "      <td>94206.0</td>\n",
       "      <td>10815.992839</td>\n",
       "      <td>10.815993</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>94</th>\n",
       "      <td>virgin_virgin</td>\n",
       "      <td>video_2017-12-20T14_01_01_arena3</td>\n",
       "      <td>1.261258e+07</td>\n",
       "      <td>1.817302e+07</td>\n",
       "      <td>419533.919242</td>\n",
       "      <td>86033.0</td>\n",
       "      <td>6992.231987</td>\n",
       "      <td>6.992232</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>95 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          condition                        experiment         pos_x  \\\n",
       "0   virgin_mated24h  video_2017-09-05T13_28_41_arena3  1.536981e+07   \n",
       "1   virgin_mated24h  video_2017-09-07T16_01_26_arena4  1.569941e+07   \n",
       "2   virgin_mated24h  video_2017-09-08T14_31_59_arena2  1.199031e+07   \n",
       "3   virgin_mated24h  video_2017-09-08T14_31_59_arena3  1.111254e+07   \n",
       "4   virgin_mated24h  video_2017-09-12T13_30_06_arena1  2.182715e+07   \n",
       "..              ...                               ...           ...   \n",
       "90    virgin_virgin  video_2017-11-02T16_11_06_arena3  1.680257e+07   \n",
       "91    virgin_virgin  video_2017-11-03T14_54_45_arena1  8.567400e+06   \n",
       "92    virgin_virgin  video_2017-11-03T16_20_50_arena4  1.998000e+07   \n",
       "93    virgin_virgin  video_2017-12-20T12_58_51_arena4  1.901919e+07   \n",
       "94    virgin_virgin  video_2017-12-20T14_01_01_arena3  1.261258e+07   \n",
       "\n",
       "           pos_y            vel  has_aggression  dist_walked_mm  \\\n",
       "0   1.684179e+07  565503.122424             0.0     9425.052040   \n",
       "1   1.569519e+07  454586.350065             0.0     7576.439168   \n",
       "2   1.093266e+07  354113.452806             0.0     5901.890880   \n",
       "3   1.272907e+07  315779.688209         59403.0     5262.994803   \n",
       "4   2.181400e+07  776363.427397        113256.0    12939.390457   \n",
       "..           ...            ...             ...             ...   \n",
       "90  1.717971e+07  474072.728796         84193.0     7901.212147   \n",
       "91  9.095781e+06  326104.065283             0.0     5435.067755   \n",
       "92  2.036970e+07  710729.939317        101285.0    11845.498989   \n",
       "93  1.845194e+07  648959.570321         94206.0    10815.992839   \n",
       "94  1.817302e+07  419533.919242         86033.0     6992.231987   \n",
       "\n",
       "    dist_walked_meters  \n",
       "0             9.425052  \n",
       "1             7.576439  \n",
       "2             5.901891  \n",
       "3             5.262995  \n",
       "4            12.939390  \n",
       "..                 ...  \n",
       "90            7.901212  \n",
       "91            5.435068  \n",
       "92           11.845499  \n",
       "93           10.815993  \n",
       "94            6.992232  \n",
       "\n",
       "[95 rows x 8 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Sum distance walked during all frames for each video and convert that to meters.\n",
    "experiments_grouped = distance_df.groupby(by=['condition', 'experiment'], as_index=False).sum()\n",
    "experiments_grouped"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## What is the total distance walked by females from the start of experiment until the end of copulation?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Statistics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\t virgin_mated24h\n",
      "Shapiro's Test: group 1 IS normally distributed.\n",
      "D'Agostino's Test: group 1 IS normally distributed.\n",
      "Shapiro's Test: group 2 IS NOT normally distributed.\n",
      "D'Agostino's Test: group 2 IS NOT normally distributed.\n",
      "Levene's Test for non-normally distributed samples:\n",
      "  p-value = 0.861699\n",
      "  All groups were sampled from populations with IDENTICAL variances.\n",
      "\n",
      "Mann-Whitney p-value: 0.16468700328016767 \n",
      "\n",
      "\n",
      "\t virgin_mated2h\n",
      "Shapiro's Test: group 1 IS normally distributed.\n",
      "D'Agostino's Test: group 1 IS normally distributed.\n",
      "Shapiro's Test: group 2 IS NOT normally distributed.\n",
      "D'Agostino's Test: group 2 IS NOT normally distributed.\n",
      "Levene's Test for non-normally distributed samples:\n",
      "  p-value = 0.320581\n",
      "  All groups were sampled from populations with IDENTICAL variances.\n",
      "\n",
      "Mann-Whitney p-value: 0.4399715032623433 \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'virgin_mated24h': 0.16468700328016767, 'virgin_mated2h': 0.4399715032623433}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dist_walked_pvalues = {}\n",
    "\n",
    "control =  experiments_grouped.query('condition==\"virgin_virgin\"')['dist_walked_meters']\n",
    "\n",
    "for condition in condition_order[1:]:\n",
    "    \n",
    "    print('\\n\\t', condition)\n",
    "    \n",
    "    try:\n",
    "        test = experiments_grouped.query('condition==\"' + condition + '\"')['dist_walked_meters']\n",
    "\n",
    "        temp_values = {'control': control, 'test': test}\n",
    "\n",
    "        pvalues = helpers.run_statistics(temp_values)\n",
    "        dist_walked_pvalues[condition] = pvalues\n",
    "        \n",
    "    except ValueError as error:\n",
    "        print(error)\n",
    "    \n",
    "dist_walked_pvalues"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Bonferroni Correction\n",
      "---------------------\n",
      "\n",
      "\tOriginal Values:\n",
      " {'virgin_mated24h': 0.16468700328016767, 'virgin_mated2h': 0.4399715032623433}\n",
      "\n",
      "\tCorrected Values:\n",
      " {'virgin_mated24h': 0.32937400656033533, 'virgin_mated2h': 0.8799430065246866}\n"
     ]
    }
   ],
   "source": [
    "# Bonferroni corretction for multiple comparisons.\n",
    "title = 'Bonferroni Correction'\n",
    "print(title)\n",
    "print('-'*len(title))\n",
    "\n",
    "# Show uncorrected values.\n",
    "print('\\n\\tOriginal Values:\\n', dist_walked_pvalues)\n",
    "\n",
    "# Apply the bonferroni correction for multiple comparisons.\n",
    "dist_walked_multi_comp_correction = multipletests(pvals=list(dist_walked_pvalues.values()), alpha=0.05, method='bonferroni')[1]\n",
    "\n",
    "# Transform the correction results into a dictionary.\n",
    "corrected_dist_walked_pvalues = dict(zip(list(dist_walked_pvalues.keys()), dist_walked_multi_comp_correction))\n",
    "\n",
    "# Show corrected values.\n",
    "print('\\n\\tCorrected Values:\\n', corrected_dist_walked_pvalues)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Effect Size"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "virgin_mated24h\n",
      "Vestigial Effect: 0.13377194702610037 \n",
      "\n",
      "virgin_mated2h\n",
      "Vestigial Effect: -0.07053029995603892 \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'virgin_mated24h': 0.13377194702610037,\n",
       " 'virgin_mated2h': -0.07053029995603892}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Calculate effect size.\n",
    "effect_sizes = {condition: 0 for condition in condition_order[1:]}\n",
    "\n",
    "control = experiments_grouped.query('condition==\"virgin_virgin\"')['dist_walked_meters']\n",
    "\n",
    "for condition in condition_order[1:]:\n",
    "    \n",
    "    print(condition)\n",
    "    \n",
    "    test = experiments_grouped.query('condition==\"' + condition + '\"')['dist_walked_meters']\n",
    "\n",
    "    median_diff = helpers.get_effect_size(control, test, method='median_diff')\n",
    "    \n",
    "    effect_sizes[condition] = median_diff\n",
    "    \n",
    "effect_sizes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQUAAAEgCAYAAAC992YUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nOzdd3hT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bnU1JSemT/CvdobMPDwwP37t3DggULOp0vKioKERERcHBwgKWlJUaMGCFYk+iNvvrqK9TX12PJkiXq5yIjI3tuh9UfHB0doVAoYGNjA6lUijfffBOnTp0C0LyQr1y5Ei+99BI2b96MefPmwcHBAUSExMREGBkZISYmBuHh4ZDJZLCxsenRzYeOxuhZ8fPzw9atW2FnZwcigre3N/Lz8wE0b2pGRkYiISEB+/btQ2RkJNatWwd9fX0cOHAAEokEsbGxCA0NRVxcHFxcXGBkZPTMamvBPRqfUGJiIkaPHg0PDw+Ul5fD29sbly9f7rf3N2B9B68pPCEbGxtERkZCpVJBKpVi+/btHAisT+A1BcaYAP9pY4wJcCgwxgQ4FBhjAhwKjDEBDgXGmACHAmNMgEOBMSbAocAYE+BQYIwJcCgwxgQ4FBhjAhwKjDEBDgXGmACHAmNMgEOBMSbAocAYE+BQYIwJcCgwxgQ4FBhjAhwKjDGB/we3g09fOqsjWAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 270x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize figure.\n",
    "n_conditions = experiments_grouped['condition'].nunique()\n",
    "figure, axis = plt.subplots(figsize=(1.25*n_conditions, 4))\n",
    "\n",
    "# Draw the oxplot.\n",
    "sns.boxplot(x='condition',\n",
    "            y='dist_walked_meters',\n",
    "            data=experiments_grouped,\n",
    "            order=condition_order,\n",
    "            palette=['steelblue', '#d72323', '#fB929e', '#1a535c'],\n",
    "            width=0.6,\n",
    "            showfliers=False,\n",
    "            boxprops={'edgecolor': INK},\n",
    "            capprops={'color': INK},\n",
    "            medianprops={'color': INK},\n",
    "            whiskerprops={'color': INK}\n",
    "           )\n",
    "\n",
    "# Draw the swarmplot.\n",
    "sns.swarmplot(x='condition',\n",
    "              y='dist_walked_meters',\n",
    "              data=experiments_grouped,\n",
    "              order=condition_order,\n",
    "              palette=['steelblue', '#d72323', '#fB929e', '#1a535c'],\n",
    "              linewidth=0.75,\n",
    "              edgecolor=INK\n",
    "             )\n",
    "\n",
    "# Figure and axes formatting.\n",
    "axis.set_xlabel('')\n",
    "axis.set_xticklabels([''])\n",
    "axis.set_ylabel('Distance (meters)')\n",
    "axis.set_ylim(0, 25)\n",
    "axis.set_yticks(range(0, 25+1, 5))\n",
    "\n",
    "# Table definition.\n",
    "row1 = [str(experiments_grouped.query('condition==\"'+condition+'\"').shape[0]) for condition in condition_order]\n",
    "row2 = ['virgin\\n', '24h-mated\\n', '2h-mated\\n'] \n",
    "cell_text = np.array([row1, row2])\n",
    "\n",
    "row_labels = ['n =', '']\n",
    "summary_table = axis.table(cellText= cell_text,\n",
    "                           cellLoc='center',\n",
    "                           rowLabels=row_labels,\n",
    "                           rowLoc='center',\n",
    "                           colLoc='center'\n",
    "                          )\n",
    "\n",
    "summary_table.auto_set_font_size(False)\n",
    "summary_table.set_fontsize(11)\n",
    "\n",
    "properties = summary_table.properties()\n",
    "table_cells = properties['children']\n",
    "for cell in table_cells:\n",
    "    cell.set_height(0.12)\n",
    "    cell.set_alpha(0)\n",
    "\n",
    "# Draw statistical results.\n",
    "for p, condition in enumerate(condition_order[1:]):\n",
    "    sig_height = 6 if (corrected_dist_walked_pvalues.get(condition, 'NaN') == 'NaN') or (corrected_dist_walked_pvalues.get(condition, 'NaN') >= 0.05) else 2\n",
    "    helpers.plot_stattest_result(ax=axis,\n",
    "                                 x1=p+1,\n",
    "                                 x2=p+1,\n",
    "                                 p_value=corrected_dist_walked_pvalues.get(condition, 'NaN'),\n",
    "                                 y=23,\n",
    "                                 ticksize=0,\n",
    "                                 xytext=(0,sig_height),\n",
    "                                 fontsize=13,\n",
    "                                 color=INK,\n",
    "                                 connector_color=INK\n",
    "                                )\n",
    "\n",
    "# Savin parameters.\n",
    "filename = 'distance_walked_start_video_end_copulation_mating_drive'\n",
    "plt.savefig(os.path.join(savepath, filename))\n",
    "\n",
    "plt.show()\n",
    "plt.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
